﻿using System.Collections.Generic;
using System.ServiceModel.Activation;
using System.Web;
using Kaesoft.Hospedaje.Business;
using System.ServiceModel.Channels;
using System.ServiceModel;

namespace Kaesoft.Hospedaje.Services
{
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class ServicioCliente : IServicioCliente
    {
        public List<string> DatosUsuario()
        {
            var lista = new List<string>();
            lista.Add(HttpContext.Current.Request.LogonUserIdentity.Name);
            lista.Add(HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]);
            return lista;
        }

        public void GrabarLog(string mensaje, string traceEvent)
        {
            if (traceEvent == "Information")
                Log.WriteTraceEntry(mensaje);
            else
                Log.WriteError(mensaje);
        }


        //public string GetData(Dictionary<string, string> value)
        //{
        //    MessageHeaders headers = OperationContext.Current.IncomingMessageHeaders;
        //    string customParameter = headers.GetHeader<string>("Identity", "http://www.adilmughal.com");
        //    return string.Format("You entered: {0}", customParameter);
        //}
    }
}